<?php /* Smarty version 2.6.18, created on 2010-03-06 20:30:09
         compiled from editcontact.tpl */ ?>
<?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
smarty_core_load_plugins(array('plugins' => array(array('modifier', 'date_format', 'editcontact.tpl', 60, false),)), $this); ?>
<script type="text/javascript">	
	<?php echo '
		Calendar.setup({
	        inputField     :    "cal[birth_date]",     // id of the input field
	        ifFormat       :    "%Y-%m-%d" ,    // format of the input field
	        displayArea    :    "birth_date",
	        daFormat       :    "%Y-%m-%d",      // format of the display area
	        button         :    "f_trigger_c1",  // trigger for the calendar (button ID)
	        align          :    "Bl",           // alignment (defaults to "Bl")
	        singleClick    :    true,
			//onUpdate	   :    endDateChanged, //event to call after calendar is closed
	        weekNumbers    :    false,
	        zIndex		   :	2000
	    });
		Calendar.setup({
	        inputField     :    "cal[license_date]",     // id of the input field
	        ifFormat       :    "%Y-%m-%d" ,    // format of the input field
	        displayArea    :    "license_date",
	        daFormat       :    "%Y-%m-%d",      // format of the display area
	        button         :    "f_trigger_c2",  // trigger for the calendar (button ID)
	        align          :    "Bl",           // alignment (defaults to "Bl")
	        singleClick    :    true,
			//onUpdate	   :    endDateChanged, //event to call after calendar is closed
	        weekNumbers    :    false,
	        zIndex		   :	2000
	    });						    
	'; ?>

</script>
<form name="mainForm" method="POST" id="mainForm">
<input type="hidden" name="user[contact_id]" value="<?php echo $this->_tpl_vars['contact'][0]['contact_id']; ?>
">
<input type="hidden" name="user[org_contact_id]" value="<?php echo $this->_tpl_vars['contact'][0]['org_contact_id']; ?>
">
<input type="hidden" name="user[staff_view]" value="<?php echo $this->_tpl_vars['staffView']; ?>
">
<input type="hidden" name="user[staff_id]" value="<?php echo $this->_tpl_vars['staffId']; ?>
">
<table class="popup" border="0" cellspacing=0 cellpadding=0>
	<tr><td><div class="pop">
		<div class="top_pop"><img src="/app/default/www/images/top_left_pop.jpg" /></div> 
		<div id="drag_bar"><h2 class="pop_h2">Edit Contact</h2></div>
		<div class="content">
			<table border="0" width="100%">
				<tr>
					<td>Contact Name:</td>
					<td><input type="text" name="user[name]" value="<?php echo $this->_tpl_vars['contact'][0]['contact_name']; ?>
" style="width:250px"></td>
				</tr>
				<tr>
					<td>Telephone&nbsp;No:</td>
					<td><input type="text" name="user[telephone_no]" value="<?php echo $this->_tpl_vars['contact'][0]['telephone_no']; ?>
" style="width:150px"></td>
				</tr>
				<tr>
					<td>Fax&nbsp;No.:</td>
					<td><input type="text" name="user[fax_no]" value="<?php echo $this->_tpl_vars['contact'][0]['fax_no']; ?>
" style="width:150px"></td>
				</tr>
				<tr>
					<td>Email:</td>
					<td><input type="text" name="user[email]" value="<?php echo $this->_tpl_vars['contact'][0]['email']; ?>
" style="width:300px"></td>
				</tr>
				<tr>
					<td>Birthdate:</td>
					<!-- <td><input type="text" name="user[birth_date]" value="<?php echo $this->_tpl_vars['contact'][0]['birth_date']; ?>
" style="width:150px"></td> -->
					<td>
						<input style="float:left" type="hidden" name="user[birth_date]" id="cal[birth_date]" value="<?php echo ((is_array($_tmp=$this->_tpl_vars['contact'][0]['birth_date'])) ? $this->_run_mod_handler('date_format', true, $_tmp, "%Y-%m-%d") : smarty_modifier_date_format($_tmp, "%Y-%m-%d")); ?>
" size="10"> 
						<span id="birth_date"  style="width:80px; display:block; float:left; height:15px; text-align:center;"><?php echo ((is_array($_tmp=$this->_tpl_vars['contact'][0]['birth_date'])) ? $this->_run_mod_handler('date_format', true, $_tmp, "%Y-%m-%d") : smarty_modifier_date_format($_tmp, "%Y-%m-%d")); ?>
</span>				
						<input style="float:left" type="image" src="/app/default/www/images/calendar.jpg" align="absmiddle" id="f_trigger_c1" style="cursor: pointer; border: 0px ;" title="Date selector"/>
						<input type="hidden" name="dateYui" value="cal[birth_date]/birth_date/f_trigger_c1">
					</td>
				</tr>
				<tr>
					<td>License&nbsp;Date:</td>
					<!-- <td><input type="text" name="user[license_date]" value="<?php echo $this->_tpl_vars['contact'][0]['license_date']; ?>
" style="width:150px"></td> -->
					<td>
						<input style="float:left" type="hidden" name="user[license_date]" id="cal[license_date]" value="<?php echo ((is_array($_tmp=$this->_tpl_vars['contact'][0]['license_date'])) ? $this->_run_mod_handler('date_format', true, $_tmp, "%Y-%m-%d") : smarty_modifier_date_format($_tmp, "%Y-%m-%d")); ?>
" size="10"> 
						<span id="license_date"  style="width:80px; display:block; float:left; height:15px; text-align:center;"><?php echo ((is_array($_tmp=$this->_tpl_vars['contact'][0]['license_date'])) ? $this->_run_mod_handler('date_format', true, $_tmp, "%Y-%m-%d") : smarty_modifier_date_format($_tmp, "%Y-%m-%d")); ?>
</span>				
						<input style="float:left" type="image" src="/app/default/www/images/calendar.jpg" align="absmiddle" id="f_trigger_c2" style="cursor: pointer; border: 0px ;" title="Date selector"/>
						<input type="hidden" name="dateYui" value="cal[license_date]/license_date/f_trigger_c2">
					</td>
				</tr>
				<tr>
					<td>Blood&nbsp;Group:</td>
					<td><input type="text" name="user[blood_group]" value="<?php echo $this->_tpl_vars['contact'][0]['blood_group']; ?>
" style="width:100px"></td>
				</tr>
				<tr>
					<td>Height (cm):</td>
					<td><input type="text" name="user[height]" value="<?php echo $this->_tpl_vars['contact'][0]['height']; ?>
" style="width:100px"></td>
				</tr>
				<tr>
					<td style="vertical-align: top;">Notes:</td>
					<td><input type="text" name="user[remarks]" value="<?php echo $this->_tpl_vars['contact'][0]['remarks']; ?>
" style="width:350px; height:50px"></td>
				</tr>
				<tr>
					<td>Default Contact:</td>
					<td><input type="checkbox" name="user[primary_contact]" <?php if ($this->_tpl_vars['contact'][0]['primary_contact'] == 'Yes'): ?> CHECKED <?php endif; ?> /></td>
				</tr>
				<tr>
					<td colspan="2" align="center">
						<input type="button" value="Save" onclick="saveContact();">&nbsp;
						<input type="button" value="Close" onclick="popup('editContact');">
					</td>
				</tr>
			</table>
		</div>
		<div class="btm_pop"><img src="/app/default/www/images/btm_left_pop.jpg"  alt="" />
	</div></td></tr>
</table>
</form>
<script language="javascript">
<?php echo '
	function saveContact() {
		popup(\'editContact\');
		doajaxAction("/account/saveContact/",1,\'main_content\',document.getElementById(\'mainForm\'));
	}

'; ?>

</script>
	